Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Logger class #397

Merged
merged 13 commits into from
Aug 16, 2021
Merged

Improve Logger class #397

merged 13 commits into from
Aug 16, 2021

Conversation

iwiznia
Copy link
Contributor

@iwiznia iwiznia commented Jul 23, 2021

Alright, please give this a review. You can see it being used in the draft PRs tied to the issue.
I basically revamped how the logging class works, mainly:

  • All logs are saved in a queue
  • alert, warn and hmmm automatically flush the queue to the server (this is basically unchanged)
  • info can chose to flush or not (this is basically unchanged)
  • Whenever we flush the queue, we flush it all
  • I removed the "extraneous" recentMessages params from alert, warn, hmmm since now they will always flush the entire queue
  • Made it so that each queue flush includes the previous queue flush requestID so you can go to the past events of one flush

This is an example of what we log in App (there's 2 requests there to see the previous requestID thingy):

2021-07-23T16:53:45.731933+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] Processing 'Log' for 'expensify.com' from '10.2.2.1'  ~~ command: 'Log' api_setCookie: 'false' logPacket: '[{"message":"[info] [NetworkConnection] listenForReconnect called","parameters":"","onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:58.741Z"},{"message":"[info] [NetworkConnection] NetInfo isConnected: true","parameters":"","onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:58.898Z"},{"message":"[info] [NetworkConnection] NetInfo isConnected: true","parameters":"","onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.532Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[242]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.594Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-1"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.638Z"},{"message":"[info] [PusherConnectionManager] connected event","parameters":"","onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.639Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-user-accountID-2"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.639Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[44]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.733Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[42]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.779Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[102]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.881Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[50]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.900Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[143]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.919Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":[21]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:52:59.932Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-1"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:00.069Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-user-accountID-2"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:00.072Z"},{"message":"[info] [Report] successfully fetched report data","parameters":{"chatList":["1","2","78","79","80","109","110","114","117","118","120"]},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:00.073Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:23.671Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:25.320Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:26.023Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/118"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:28.687Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-118"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:29.519Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-118"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:31.422Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/118"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:32.350Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/126"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:32.860Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-126"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:33.201Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-126"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:33.587Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/117"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:33.770Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-117"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:33.977Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/120"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:34.245Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-117"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:34.405Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-120"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:34.471Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-120"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:34.752Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:35.896Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:36.106Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:36.323Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/1"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:36.540Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-1"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:36.745Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-1"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:36.977Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:41.242Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:41.459Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-report-reportID-114"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:41.654Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/117"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:42.377Z"},{"message":"[info] Navigating to route","parameters":{"route":"r\/126"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:43.819Z"},{"message":"[info] [PusherConnectionManager] Attempting to authorize Pusher","parameters":{"channelName":"private-report-reportID-126"},"onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:53:44.032Z"},{"message":"[info] [PusherConnectionManager] Pusher authenticated successfully","parameters":{"channelName":"private-re
2021-07-23T16:53:45.732227+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [dbug] _send( expensidev2004.web.api.command.Log:1|c )
2021-07-23T16:53:45.733686+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [NetworkConnection] listenForReconnect called ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.734544+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [NetworkConnection] NetInfo isConnected: true ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.735178+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [NetworkConnection] NetInfo isConnected: true ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736109+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '242']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736256+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-1' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736429+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] connected event ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736506+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-user-accountID-2' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736551+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '44']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736774+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '42']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736867+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '102']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.736966+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '50']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737035+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '143']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737145+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '21']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737205+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-1' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737259+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-user-accountID-2' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737340+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [Report] successfully fetched report data ~~ chatList: '[0: '1' 1: '2' 2: '78' 3: '79' 4: '80' 5: '109' 6: '110' 7: '114' 8: '117' 9: '118' 10: '120']' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737407+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737553+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.737607+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.738100+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/118' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.738388+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-118' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.738925+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-118' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.739099+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/118' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.739380+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/126' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.739949+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-126' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740051+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-126' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740113+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/117' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740153+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-117' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740199+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/120' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740243+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-117' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740757+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-120' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.740888+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-120' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.741191+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.743286+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.743446+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.744656+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/1' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.745197+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-1' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.746073+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-1' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.747482+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.747882+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.748042+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-114' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.749278+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/117' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.749690+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Navigating to route ~~ route: 'r/126' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.749813+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Attempting to authorize Pusher ~~ channelName: 'private-report-reportID-126' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.750048+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] [PusherConnectionManager] Pusher authenticated successfully ~~ channelName: 'private-report-reportID-126' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.750265+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Flushing logs as app is going inactive ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.750471+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info]  ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:53:45.750577+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] StoreUtils - Clearing all the stores.
2021-07-23T16:53:45.750846+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] TransactionStore cache fully cleared
2021-07-23T16:53:45.750947+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] ReportStore cache cleared
2021-07-23T16:53:45.751137+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] NVPStore - clear cache
2021-07-23T16:53:45.751494+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] NVPStore - clear cache
2021-07-23T16:53:45.751955+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] SharedInNVPStore - clear cache
2021-07-23T16:53:45.752206+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] ReportDuplicatedTransactionsStore - Cache cleared
2021-07-23T16:53:45.752403+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [dbug] _send( expensidev2004.web.api.result.success.200:1|c )
2021-07-23T16:53:45.752456+00:00 expensidev2004 php-fpm: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.0.2.2:9000 (through xdebug.client_host/xdebug.client_port) :-(
2021-07-23T16:53:45.752611+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] Profile ~~ {"total":22,"cmd":"Log","jsonCode":200,"output":{"size":57,"gzip":1,"ratio":154},"gzip":57,"PHP":{"total":21,"%":95,"boot":8,"proc":13,"pack":0,"mem":2}}
2021-07-23T16:53:45.752805+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [info] Timing: cmd= Log totalTime= 22 authTotalTime=  authRunTime= 0
2021-07-23T16:53:45.752986+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [dbug] _send( expensidev2004.web.api.Log:22|ms )
2021-07-23T16:53:45.753039+00:00 expensidev2004 php-fpm: nMxTXg /api.php ionatan@expensify.com !ecash! ?api? [dbug] _send( global.web.api.Log:22|ms )
2021-07-23T16:53:45.753173+00:00 expensidev2004 php-fpm: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.0.2.2:9000 (through xdebug.client_host/xdebug.client_port) :-(
2021-07-23T16:53:45.753335+00:00 expensidev2004 nginx: remote_addr=10.2.2.1 host=www.expensify.com.dev remote_user=- [23/Jul/2021:16:53:45 +0000] request_method=POST request=/api?<stripped> server_protocol=HTTP/2.0 http_status=200 body_bytes_sent=57 http_user_agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36" upstream_status=200 request_time=0.060 upstream_response_time=0.060 upstream_connect_time=0.000 upstream_header_time=0.060
2021-07-23T16:53:47.463176+00:00 expensidev2004 bedrock: xxxxxx (SQLiteNode.cpp:555) update [sync] [info] {auth/LEADING} [performance] Network stats: 10017 ms elapsed.
2021-07-23T16:53:48.478508+00:00 expensidev2004 bedrock: xxxxxx (main.cpp:380) main [main] [info] [performance] main poll loop timing: 10528 ms elapsed. 10481 ms in poll. 45 ms in postPoll.
2021-07-23T16:53:51.478662+00:00 expensidev2004 bedrock: xxxxxx (main.cpp:380) main [main] [info] [performance] main poll loop timing: 10031 ms elapsed. 10030 ms in poll. 1 ms in postPoll.
2021-07-23T16:53:53.475563+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread poll): 10025/10028 ms timed, 99.97%
2021-07-23T16:53:53.476121+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (STCPNode::append): 0/10028 ms timed, 0.00%
2021-07-23T16:53:54.480186+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread poll): 10029/10031 ms timed, 99.98%
2021-07-23T16:53:54.480418+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (STCPNode::append): 0/10031 ms timed, 0.00%
2021-07-23T16:53:54.480533+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread PostPoll): 1/10032 ms timed, 0.01%
2021-07-23T16:53:54.480620+00:00 expensidev2004 bedrock: xxxxxx (SQLiteNode.cpp:555) update [sync] [info] {bedrock/LEADING} [performance] Network stats: 10032 ms elapsed.
2021-07-23T16:53:54.480738+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread escalate loop): 0/10032 ms timed, 0.00%
2021-07-23T16:53:55.497010+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread PostPoll): 0/10035 ms timed, 0.00%
2021-07-23T16:53:55.497160+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread escalate loop): 0/10035 ms timed, 0.00%
2021-07-23T16:53:57.497835+00:00 expensidev2004 bedrock: xxxxxx (SQLiteNode.cpp:555) update [sync] [info] {auth/LEADING} [performance] Network stats: 10035 ms elapsed.
2021-07-23T16:53:58.644569+00:00 expensidev2004 bedrock: xxxxxx (main.cpp:380) main [main] [info] [performance] main poll loop timing: 10165 ms elapsed. 10163 ms in poll. 2 ms in postPoll.
2021-07-23T16:54:01.503135+00:00 expensidev2004 bedrock: xxxxxx (main.cpp:380) main [main] [info] [performance] main poll loop timing: 10024 ms elapsed. 10023 ms in poll. 1 ms in postPoll.
2021-07-23T16:54:03.504259+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread poll): 10026/10029 ms timed, 99.97%
2021-07-23T16:54:03.504498+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (STCPNode::append): 0/10028 ms timed, 0.00%
2021-07-23T16:54:04.505888+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread poll): 10023/10026 ms timed, 99.97%
2021-07-23T16:54:04.506669+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (STCPNode::append): 0/10026 ms timed, 0.00%
2021-07-23T16:54:04.506772+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread PostPoll): 1/10026 ms timed, 0.01%
2021-07-23T16:54:04.506829+00:00 expensidev2004 bedrock: xxxxxx (SQLiteNode.cpp:555) update [sync] [info] {bedrock/LEADING} [performance] Network stats: 10026 ms elapsed.
2021-07-23T16:54:04.506883+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread escalate loop): 0/10026 ms timed, 0.00%
2021-07-23T16:54:05.507420+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread PostPoll): 1/10010 ms timed, 0.01%
2021-07-23T16:54:05.507661+00:00 expensidev2004 bedrock: xxxxxx (STCPNode.h:24) stop [sync] [info] [performance] AutoTimer (sync thread escalate loop): 0/10010 ms timed, 0.00%
2021-07-23T16:54:07.514086+00:00 expensidev2004 bedrock: xxxxxx (SQLiteNode.cpp:555) update [sync] [info] {auth/LEADING} [performance] Network stats: 10016 ms elapsed.
2021-07-23T16:54:08.673926+00:00 expensidev2004 bedrock: xxxxxx (main.cpp:380) main [main] [info] [performance] main poll loop timing: 10028 ms elapsed. 10023 ms in poll. 5 ms in postPoll.
2021-07-23T16:54:11.520372+00:00 expensidev2004 bedrock: xxxxxx (main.cpp:380) main [main] [info] [performance] main poll loop timing: 10017 ms elapsed. 10016 ms in poll. 0 ms in postPoll.
2021-07-23T16:54:12.665209+00:00 expensidev2004 php-fpm: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.0.2.2:9000 (through xdebug.client_host/xdebug.client_port) :-(
2021-07-23T16:54:12.709009+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [info] ACHTUNG debug mode is ON
2021-07-23T16:54:12.712159+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [info] PID ~~ 114118
2021-07-23T16:54:12.713507+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [dbug] [10.2.2.1->/api.php] Unexpected REQUEST 'forceNetworkRequest' => 'true'
2021-07-23T16:54:12.714938+00:00 expensidev2004 php-fpm: Xdebug: [Step Debug] Could not connect to debugging client. Tried: 10.0.2.2:9000 (through xdebug.client_host/xdebug.client_port) :-(
2021-07-23T16:54:12.716384+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [info] Processing 'Log' for 'expensify.com' from '10.2.2.1'  ~~ command: 'Log' api_setCookie: 'false' logPacket: '[{"message":"[info] Previous log requestID","parameters":{"requestID":"nMxTXg"},"onlyFlushWithOthers":true,"timestamp":"2021-07-23T16:53:45.618Z"},{"message":"[info] Caca for testing!","parameters":"","onlyFlushWithOthers":false,"timestamp":"2021-07-23T16:54:12.525Z"}]' expensifyCashAppVersion: 'expensifyCash[web]1.0.79-3' email: 'ionatan@expensify.com' referer: 'ecash' browserGUID: '60faf434ae9cd' partnerName: 'expensify.com'
2021-07-23T16:54:12.716991+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [dbug] _send( expensidev2004.web.api.command.Log:1|c )
2021-07-23T16:54:12.717400+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Previous log requestID ~~ requestID: 'nMxTXg' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'
2021-07-23T16:54:12.717644+00:00 expensidev2004 php-fpm: BBQdxV /api.php ionatan@expensify.com !ecash! ?api? [info] [info] Caca for testing! ~~ userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36'

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/171640

Tests

  1. See other PRs

QA

  1. No

@iwiznia iwiznia self-assigned this Jul 23, 2021
@github-actions
Copy link

github-actions bot commented Jul 23, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@iwiznia
Copy link
Contributor Author

iwiznia commented Jul 23, 2021

I have read the CLA Document and I hereby sign the CLA

@iwiznia
Copy link
Contributor Author

iwiznia commented Jul 23, 2021

recheck

expect(mockServerLoggingCallback).toHaveBeenCalledWith(
expect.objectContaining({
api_setCookie: false,
logPacket: expect.any(String),
Copy link
Contributor Author

@iwiznia iwiznia Jul 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests are now a bit shitty, since the logPacket contains a timestamp, I don't know how to make this test a bit better (like check its including the actual log lines).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jest functions can have their arguments inspected so that might be one way?

e.g. mockServerLoggingCallback.mock.calls should return an array of arrays representing each calls arguments. So to get the first argument of the first call you'd do

mockServerLoggingCallback.mock.calls[0][0]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then we can do like expect(args).toEqual({something: 'blah'})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, did not know that, will try it

@iwiznia iwiznia changed the title Add defaults to log methods Improve Logger class Jul 23, 2021
@@ -81,60 +73,51 @@ export default class Logger {
* @param {String} message The message to log.
* @param {Boolean} sendNow if true, the message will be sent right away.
* @param {Object|String} parameters The parameters to send along with the message
* @param {Boolean} onlyFlushWithOthers A request will never be sent to the server if all loglines have this set to true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this param for 2 reasons:

  1. I did not want it to be sending a request to the server with only this message as that would be useless
  2. Same thing happens with this log line

@iwiznia
Copy link
Contributor Author

iwiznia commented Jul 23, 2021

Please review this even if on hold. Once this is approved, I need to update all the PRs in all the repos using this.

@iwiznia iwiznia marked this pull request as ready for review July 23, 2021 16:46
@iwiznia iwiznia requested a review from a team as a code owner July 23, 2021 16:46
@iwiznia iwiznia changed the title Improve Logger class [HOLD] Improve Logger class Jul 23, 2021
@MelvinBot MelvinBot requested review from Luke9389 and removed request for a team July 23, 2021 16:46
@iwiznia iwiznia requested review from marcaaron and a team and removed request for Luke9389 July 23, 2021 16:46
@MelvinBot MelvinBot requested review from Luke9389 and removed request for a team July 23, 2021 16:47
@iwiznia
Copy link
Contributor Author

iwiznia commented Jul 27, 2021

Bump!

expect(mockServerLoggingCallback).toHaveBeenCalledWith(
expect.objectContaining({
api_setCookie: false,
logPacket: expect.any(String),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jest functions can have their arguments inspected so that might be one way?

e.g. mockServerLoggingCallback.mock.calls should return an array of arrays representing each calls arguments. So to get the first argument of the first call you'd do

mockServerLoggingCallback.mock.calls[0][0]

expect(mockServerLoggingCallback).toHaveBeenCalledWith(
expect.objectContaining({
api_setCookie: false,
logPacket: expect.any(String),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then we can do like expect(args).toEqual({something: 'blah'})

lib/Logger.jsx Outdated Show resolved Hide resolved
lib/Logger.jsx Show resolved Hide resolved
lib/Logger.jsx Show resolved Hide resolved
lib/Logger.jsx Show resolved Hide resolved
@iwiznia
Copy link
Contributor Author

iwiznia commented Jul 28, 2021

Updated

@marcaaron marcaaron self-requested a review July 29, 2021 00:51
marcaaron
marcaaron previously approved these changes Jul 29, 2021
lib/Logger.jsx Show resolved Hide resolved
@marcaaron marcaaron requested review from marcaaron and removed request for Luke9389 July 29, 2021 16:10
@iwiznia
Copy link
Contributor Author

iwiznia commented Jul 29, 2021

Had to update this to fix a bug when testing Expensify/App#4191

marcaaron
marcaaron previously approved these changes Jul 29, 2021
Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@iwiznia
Copy link
Contributor Author

iwiznia commented Aug 13, 2021

ok, I updated this and am working through to update and re-test the other PRs, please approve. I will merge them all once they are all ready.

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Unsure if this is still on HOLD but feel free to merge.

return this.logLines.slice(this.logLines.length - count);
// If we're over the limit, flush the logs
if (length > MAX_LOG_LINES_BEFORE_FLUSH || forceFlushToServer) {
this.logToServer()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB missing semi colon

@iwiznia iwiznia changed the title [HOLD] Improve Logger class Improve Logger class Aug 16, 2021
@iwiznia iwiznia merged commit 811d146 into master Aug 16, 2021
@iwiznia iwiznia deleted the ionatan_defaultparams_log branch August 16, 2021 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants